package com.x.provider.oss.controller.app;

import com.x.core.web.api.R;
import com.x.core.web.controller.BaseController;
import com.x.provider.oss.model.vo.vod.VodUploadParamVO;
import com.x.provider.oss.service.FaceIdService;
import com.x.provider.oss.service.VodService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotBlank;

@Api(tags = "人脸核身服务")
@RestController
@RequestMapping("/app/face/id")
public class FaceIdController extends BaseController {

    private final FaceIdService faceIdService;

    public FaceIdController(FaceIdService faceIdService){
        this.faceIdService = faceIdService;
    }

    @ApiOperation(value = "身份证认证,没有返回错误码表示成功")
    @GetMapping("/card/verification")
    public R<Void> getVodUploadParam(@RequestParam @NotBlank @ApiParam(value = "身份证号") String idCard,
                                                 @RequestParam @NotBlank @ApiParam(value = "姓名") String name){
        getCurrentCustomerId();
        faceIdService.idCardVerification(idCard, name);
        return R.ok();
    }
}
